package com.example.HelloSpace.database.entities;

import androidx.room.Entity;
import androidx.room.Ignore;
import androidx.room.PrimaryKey;
import androidx.room.TypeConverters;
import com.example.HelloSpace.database.Converters;

import java.time.Instant;

@Entity(tableName = "space_missions")
@TypeConverters({Converters.class})
public class SpaceMissionEntity {
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public Instant getLaunchTimeUtc() {
        return launchTimeUtc;
    }

    public void setLaunchTimeUtc(Instant launchTimeUtc) {
        this.launchTimeUtc = launchTimeUtc;
    }

    public String getMissionName() {
        return missionName;
    }

    public void setMissionName(String missionName) {
        this.missionName = missionName;
    }
    // 全参数构造函数
    @Ignore
    public SpaceMissionEntity(int id, String missionName, Instant launchTimeUtc, boolean isCountingDown, String launchTime, String status) {
        this.id = id;
        this.missionName = missionName;
        this.launchTimeUtc = launchTimeUtc;
        this.isCountingDown = isCountingDown;
        this.launchTime = launchTime;
        this.status = status;
    }

    // 无参构造函数，Room 需要它来实例化对象
    public SpaceMissionEntity() {}

    @PrimaryKey
    public int id;
    public String missionName;
    public Instant launchTimeUtc; // 使用Instant存储UTC时间
    public String launchTime;
    public boolean isCountingDown;
    public String status;

}
